package org.langqiao.network;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class MyServer {
	
	public static List<Socket> socketList = new ArrayList<Socket>();
	public static void main(String[] args) throws IOException {
		ServerSocket ss = new ServerSocket(30002);
		
		while (true) {
			Socket s = ss.accept();
			socketList.add(s);
			
			//每当客户端连接后，启动一条ServerThread线程为客服端服务
			new Thread(new ServerThread(s)).start();
		}
		
	}

}
